/**
 * Package: System.Clock
 */

// Clock
#define CLOCK_SEC  0
#define CLOCK_MIN  1
#define CLOCK_HOUR 2
#define CLOCK_DAY  3
#define CLOCK_MON  4
#define CLOCK_YEAR 5
#define CLOCK_TICK 6

/// <summary>Sets the time of the internal software clock.</summary>
/// <param name="hour">Hour.</param>
/// <param name="min">Minute.</param>
/// <param name="sec">Second.</param>
/// <param name="corr">Correction Factor.</param>
void Clock_SetTime $opc(0x83) (byte hour, byte minute, byte second, char corr);

/// <summary>Sets the date of the internal software clock.</summary>
/// <param name="day">Day.</param>
/// <param name="mon">Month.</param>
/// <param name="year">Year.</param>
void Clock_SetDate $opc(0x84) (byte day, byte month, byte year);

/// <summary>All Date and Time values of the internal software clock can be read.</summary>
/// <param name="indx">Index of date or time parameter.</param>
/// <returns>Thr return value.</returns>
byte Clock_GetVal $opc(0x85) (byte index);

/// <summary>Returns the year value.</summary>
/// <returns>The year.</returns>
byte Clock_GetYear(void)
{
    return Clock_GetVal(CLOCK_YEAR);
}

/// <summary>Returns the month value.</summary>
/// <returns>The month.</returns>
byte Clock_GetMonth(void)
{
    return Clock_GetVal(CLOCK_MON);
}

/// <summary>Returns the day value.</summary>
/// <returns>The day.</returns>
byte Clock_GetDay(void)
{
    return Clock_GetVal(CLOCK_DAY);
}

/// <summary>Returns the hour value.</summary>
/// <returns>The hour.</returns>
byte Clock_GetHour(void)
{
    return Clock_GetVal(CLOCK_HOUR);
}

/// <summary>Returns the minute value.</summary>
/// <returns>The minute.</returns>
byte Clock_GetMinute(void)
{
    return Clock_GetVal(CLOCK_MIN);
}

/// <summary>Returns the second value.</summary>
/// <returns>The second.</returns>
byte Clock_GetSecond(void)
{
    return Clock_GetVal(CLOCK_SEC);
}

/// <summary>Returns the tick value.</summary>
/// <returns>The tick value.</returns>
byte Clock_GetTick(void)
{
    return Clock_GetVal(CLOCK_TICK);
}